﻿
    var PreLock = false;
    $(".next").click(function () {
        if (!PreLock) {
            PreLock = true;
            var _div = $(this).parent().children()[1];
            var _ul = $(_div).children()[0];
            var maxLength = $(_ul).children().length;
            marLeft = _ul.offsetLeft - _div.offsetLeft - 472;
            if ((_div.offsetLeft - _ul.offsetLeft) % 472 > 0) {
                var ResLeft = (_div.offsetLeft - _ul.offsetLeft) % 472;
                if (ResLeft > 0 && ResLeft < 10) { marLeft = marLeft + ResLeft }
                else {
                    marLeft = marLeft - ResLeft
                }
            }
            if (marLeft > -(maxLength * 472)) {
                $($(this).parent().children()[0]).css("visibility", "visible");
                $(this).css("visibility", "visible");
                $(_ul).animate({ marginLeft: marLeft }, function () { PreLock = false; });
            } else if (marLeft <= -((maxLength - 1) * 472)) {
                $(this).css("visibility", "hidden");
                PreLock = false;
            }
        }
    })
    $(".prev").click(function () {
        if (!PreLock) {
            PreLock = true;
            var _div = $(this).parent().children()[1];
            var _ul = $(_div).children()[0];
            marLeft = _ul.offsetLeft - _div.offsetLeft + 472;
            if ((_div.offsetLeft - _ul.offsetLeft) % 472 > 0) {
                var ResLeft = (_div.offsetLeft - _ul.offsetLeft) % 472;
                if (ResLeft > 0 && ResLeft < 10) { marLeft = marLeft + ResLeft }
                else {
                    marLeft = marLeft - ResLeft
                }
            }
            if (marLeft <= 0) {
                $($(this).parent().children()[2]).css("visibility", "visible");
                $(this).css("visibility", "visible");
                $(_ul).animate({ marginLeft: marLeft }, function () { PreLock = false; });
            } else if (marLeft >= 0) {
                $(this).css("visibility", "hidden");
                PreLock = false;
            }
        }
    })
    var nar = document.all ? "IE" : "others";
    var navigator_userAgent = Browser.Agent();
    if (nar == "IE") {
        if (navigator_userAgent == "IE7" || navigator_userAgent == "other version") return;
    }
    $(".moveConn .li1").mouseover(function () {
        var destination = $(".conn1").offset().top - 180;
        $("html, body").animate({ scrollTop: destination }, { duration: 600, queue: false });
    })
    $(".moveConn .li2").mouseover(function () {
        var destination = $(".conn2").offset().top - 170;
        $("html, body").animate({ scrollTop: destination }, { duration: 600, queue: false });
    })
    $(".moveConn .li3").mouseover(function () {
        var destination = $(".conn3").offset().top - 210;
        $("html, body").animate({ scrollTop: destination }, { duration: 600, queue: false });
    })
    $(".moveConn .li4").mouseover(function () {
        var destination = $(".conn4").offset().top - 220;
        $("html, body").animate({ scrollTop: destination }, { duration: 600, queue: false });
    })
    $(window).scroll(function () {
        var offsetT = 520 + $(window).scrollTop();
        if (offsetT > 1040) {
            $(".moveConn").css("marginTop", "-522px");
            $(".moveConn").css("position", "fixed");
            $(".moveConn li").css("color", "#013D93");
            $(".moveConn li").css("background-image", "");
            if (offsetT > 1040 && offsetT < 1370) {
                $(".moveConn .li1").css("color", "#fff");
                $(".moveConn .li1").css("background-image", "url(../../content/img/index/Newbie/xszy_05-01_05.png)");
            }
            if (offsetT >= 1370 && offsetT < 1890) {
                $(".moveConn .li2").css("color", "#fff");
                $(".moveConn .li2").css("background-image", "url(../../content/img/index/Newbie/xszy_05-02_05.png)");
            }
            if (offsetT >= 1890 && offsetT < 2420) {
                $(".moveConn .li3").css("color", "#fff");
                $(".moveConn .li3").css("background-image", "url(../../content/img/index/Newbie/xszy_05-03_05.png)");
            }
            if (offsetT >= 2420 && offsetT < 3000) {
                $(".moveConn .li4").css("color", "#fff");
                $(".moveConn .li4").css("background-image", "url(../../content/img/index/Newbie/xszy_05-04_05.png)");
            }
        }
        else {
            $(".moveConn").css("marginTop", "0px");
            $(".moveConn").css("position", "inherit");
        }
    })